# start = int(input("请输入数列的起始项位置："))
# end = int(input("请输入数列的结束项位置："))
#
# def fibonacci(n):
#     if n<=0:
#         return []
#     elif n==1:
#        return [0]
#     elif n==2:
#         return [0,1]
#     fib = [0,1]
#     for i in range(2,n):
#         next=fib[i-1]+fib[i-2]
#         fib.append(next)
#     return fib
#
# seq=fibonacci(end)
# selected = seq[start-1:end]
#
# print(f"第{start}项到第{end}项斐波那契数列：{selected}")



start = int(input("请输入数列的起始项位置："))
end = int(input("请输入数列的结束项位置："))

def fibonacci(n):
    if n<=1:
        return 0
    elif n==2:
        return 1
    else:
        return fibonacci(n-1)+fibonacci(n-2)

seq=[]
for i in range(1,end+1):
    seq.append(fibonacci(i))

selected = seq[start-1:end]

print(f"第{start}项到第{end}项斐波那契数列：{selected}")